UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SevecAiWQ8ezDhKBldCRdPtDKQ6xRww1E+jCyPfWhQM='
WHERE
key_id = 'dbf1a47224653558fccc34a46346aada9b4a45554c3e1fe1a7c5c006f4aedee7'
AND (
token = 'SevecAiWQ8ezDhKBldCRdPtDKQ6xRww1E+jCyPfWhQM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)