UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9jeL6rJTHxBuHYjsoJ46brEYmMKqg/a52qxnAibi60c='
WHERE
key_id = '0b2b328453e35b4911c86dec98472b340765ae491860456eb458b4e3573aac7c'
AND (
token = '9jeL6rJTHxBuHYjsoJ46brEYmMKqg/a52qxnAibi60c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)