UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Zn2ZnoCjocNLQ9En8H+F+r8nc/JSvJmC8hL1h4MffI='
WHERE
key_id = 'd07bc14a8191e59fd180cbebf8e0ffe10dd0280563c727264b7421e98cad1476'
AND (
token = '2Zn2ZnoCjocNLQ9En8H+F+r8nc/JSvJmC8hL1h4MffI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)