UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kKf5UDNYy9c9nis1hGc0jWJgh6iZWFB48vE5ArbiH4A='
WHERE
key_id = '801c10be58beb1ec1267584f9e03d783e35c218760cc1ccfed7401795a9dd0e5'
AND (
token = 'kKf5UDNYy9c9nis1hGc0jWJgh6iZWFB48vE5ArbiH4A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)