UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rJWY5us3mu6KnVZUDi39gKk9B11bTLSCjZVQiHGbLh8='
WHERE
key_id = '25f93b622dbe9dce0e1325270629007ff6ebce21670d3a6877f3575dfa26adcc'
AND (
token = 'rJWY5us3mu6KnVZUDi39gKk9B11bTLSCjZVQiHGbLh8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)