UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+L6cmsCPhjti+T1gAlnm6LhR24ABMZB0KQYPIZu97O0='
WHERE
key_id = '57d7581a546e8f249a923fbcf56c8e9e35dff080fa1a3f49581107e3ba38922e'
AND (
token = '+L6cmsCPhjti+T1gAlnm6LhR24ABMZB0KQYPIZu97O0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)