UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FPazkTzY9G9E7cHwKMRDY9ENUgNE1/FvPgNsMv1/Cyg='
WHERE
key_id = 'e34674876975bd26737f7a253135c08ff447063e68419aabc7d20ec6720e4ed0'
AND (
token = 'FPazkTzY9G9E7cHwKMRDY9ENUgNE1/FvPgNsMv1/Cyg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)