UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2XMlQrBXsgem+6r8YFilCAsVKECFgHr8bfO3Cc6giGo='
WHERE
key_id = '7799e9223544d675d0d4733ceea3d226a3f98a21def0cf55d72ae6147f7ca6e7'
AND (
token = '2XMlQrBXsgem+6r8YFilCAsVKECFgHr8bfO3Cc6giGo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)