UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lRd5TJH0S8KzP/PciWr4SeYlSW0S1o7FUckfWUhYbZw='
WHERE
key_id = '3463a2fb37474b0e29ad70177b19a10e9492b8531d27e4935252788155fafba0'
AND (
token = 'lRd5TJH0S8KzP/PciWr4SeYlSW0S1o7FUckfWUhYbZw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)