UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AP9Cqf0YK8OcvOp4nSyR+XR0BT7T8+EEG8r4TPyB8sg='
WHERE
key_id = '85af53ce7568ad70e35ec61b4bfa763a36d884a1ecdab46ada8294b84dadb14e'
AND (
token = 'AP9Cqf0YK8OcvOp4nSyR+XR0BT7T8+EEG8r4TPyB8sg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)