UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FV0xCIpFG93MvfWZxZNaGKeYRFl6NL2ywTBT1/uiaRU='
WHERE
key_id = '3124dbeddb1759ef103ee53309ff1d692ccd5ee90fba075563582b7888fa5ac4'
AND (
token = 'FV0xCIpFG93MvfWZxZNaGKeYRFl6NL2ywTBT1/uiaRU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)