UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6hNo7L9xuQvOEPvjCK6pwgnwjYD4ZOqjchmEjjcPab4='
WHERE
key_id = '7fa421c84526ae4323357f642c92ca5a7d9a1ea5c6f0382e06b6506a48323883'
AND (
token = '6hNo7L9xuQvOEPvjCK6pwgnwjYD4ZOqjchmEjjcPab4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)