UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VBNM+oaDcJhEIVTmRKkaMesu+w59O295Vo/G99ZcLHw='
WHERE
key_id = '631398f94e5b5fb63ce99f2fc0d3d41ad715588365edc56684cd4273e70e0a06'
AND (
token = 'VBNM+oaDcJhEIVTmRKkaMesu+w59O295Vo/G99ZcLHw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)