UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xtr8kI3IfdAiwvoFE58rTNs5pCsKL3W7SS4FuwAgAn4='
WHERE
key_id = 'e28e6da999f4ee66356449997f82e83eb73775f013867eed7021877eede2f124'
AND (
token = 'Xtr8kI3IfdAiwvoFE58rTNs5pCsKL3W7SS4FuwAgAn4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)