UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nXXw0J94QhRC95sd9KJrcBP0x7LpPiRXZNLLLsM7IOc='
WHERE
key_id = '950c2e0a41994998c586376cbbf3c0e66c9ce67420c4edd787bddbb96e09cdbc'
AND (
token = 'nXXw0J94QhRC95sd9KJrcBP0x7LpPiRXZNLLLsM7IOc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)