UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5jc8YatxyAHuEYfv8kk3TgGkyAk8w9AMQM4svu0tgdE='
WHERE
key_id = 'e5423ec0ddbbf7adeca3bd7ac642f2ca7482dc85d5a9ae169ae0ed7039ef8e3c'
AND (
token = '5jc8YatxyAHuEYfv8kk3TgGkyAk8w9AMQM4svu0tgdE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)