UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S6eDIaJyw1OzOKnIYXen/MjfYi0eFZ2H/pkJOO7Au18='
WHERE
key_id = '53ac0b34e30a6829186eee699b6ef9a045813f2bba9070f63387af3019df228c'
AND (
token = 'S6eDIaJyw1OzOKnIYXen/MjfYi0eFZ2H/pkJOO7Au18='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)