UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5THm+U+eQWO2RznsIZOMFL71jSO57PF0kR0vy1B++oE='
WHERE
key_id = 'dcada321a4580d6af71b9028262e66104985fbcbbb57bfb3277bc1a8ebf19756'
AND (
token = '5THm+U+eQWO2RznsIZOMFL71jSO57PF0kR0vy1B++oE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)