UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9HMRzM5UL88hwlPoweQgjV7Mjjp9b/XIyYm4oBy4YbA='
WHERE
key_id = '97b34bfb8be2f0e4068a1d10070d4377bb625ec602a1b119a1a908900b0295b5'
AND (
token = '9HMRzM5UL88hwlPoweQgjV7Mjjp9b/XIyYm4oBy4YbA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)