UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j+o+/kIlriVWFSXfiRxoeH6rIeoEnNZwhr3aUQsLWb0='
WHERE
key_id = 'a8287079e4170bd88a7104e7d64ddfed17982f47bd4d514a7150a585c7437866'
AND (
token = 'j+o+/kIlriVWFSXfiRxoeH6rIeoEnNZwhr3aUQsLWb0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)