UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UgZq9askrcYqe1efKd3a9FzeSOofzbav7Sllg7y3aYU='
WHERE
key_id = '41e432e994a53d5c14958a5f8a8610169e19e8d6a5cbf9ffd359ffb779c909d4'
AND (
token = 'UgZq9askrcYqe1efKd3a9FzeSOofzbav7Sllg7y3aYU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)