UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5X16McGUZEytDZwTRWdZPf1JR3a+A/ShudcU3OLfl+c='
WHERE
key_id = 'c2ffcc2ce72959f980dadf5c39b6c02275ec37fc626de18c9240e44d19cbd192'
AND (
token = '5X16McGUZEytDZwTRWdZPf1JR3a+A/ShudcU3OLfl+c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)