UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aL2MOsCLCR7aiEX6J1H6o/JTs1whKTSucrHuwqf4JdI='
WHERE
key_id = '7740b71557125e24a77d6c0c60c79cb1df99fe56dd3f89d38a368e9b001beb2c'
AND (
token = 'aL2MOsCLCR7aiEX6J1H6o/JTs1whKTSucrHuwqf4JdI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)