UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OP+xN1mUXer4ishFw3b4LCQPF/jhvAjJvq23LoEguTE='
WHERE
key_id = 'f693cd73704f5011d00bfa17bd0fbe4ed4fbe56e664712d6cb63edccf0911bdb'
AND (
token = 'OP+xN1mUXer4ishFw3b4LCQPF/jhvAjJvq23LoEguTE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)