UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H4PwwUN4eg85JacQ7nS86b6k/n05hBAGUWrAgrYczk4='
WHERE
key_id = 'a97304bc5032ad2c05963d5b859ef823e5f91b8442e14fb9fa480755938b868e'
AND (
token = 'H4PwwUN4eg85JacQ7nS86b6k/n05hBAGUWrAgrYczk4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)