UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qf/RPxgMPDZxYrXAxH8+3XitQo7EVYm+BegUkgyoNVY='
WHERE
key_id = 'f0c7ec5ef6bc7274c49711be1a53f4f8ea669a71c03898d91405b808ae9b6e27'
AND (
token = 'qf/RPxgMPDZxYrXAxH8+3XitQo7EVYm+BegUkgyoNVY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)