UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sOrSYeQRwpqTD8Mq40A4RpQ440EXz8pdosJY7pG2aac='
WHERE
key_id = '1b5c43d182c4e975b9a0649cabaa7626caf9ebff1bdffd246b83b0992a84c5b6'
AND (
token = 'sOrSYeQRwpqTD8Mq40A4RpQ440EXz8pdosJY7pG2aac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)