UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3sHUvTSZEj+UOi1E2wjiBAjdGj5Fk/k/oc1uILJq4/s='
WHERE
key_id = 'faa92d592dfa04a26c99213df8a050c2ab8e99e1077b7b61eac5be8cc2141f8d'
AND (
token = '3sHUvTSZEj+UOi1E2wjiBAjdGj5Fk/k/oc1uILJq4/s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)