UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/14txTBD45aCedIn7Qt1848iFv3htq8lUkOyR47m+P4='
WHERE
key_id = 'c023dfd07bd39dd143f705ae0805b6e43ac349fb763d3b2b2e6ff99f8a7a6d96'
AND (
token = '/14txTBD45aCedIn7Qt1848iFv3htq8lUkOyR47m+P4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)