UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kd4vVIo4p39HygFHbd3MssFEvmnwRb7qVPG8Rv5We4E=' 
WHERE 
  key_id = '4cd46dd56512288eb61c916be6ac08e24164d0157aee60517b7e32eeaa62d879' 
  AND (
    token = 'kd4vVIo4p39HygFHbd3MssFEvmnwRb7qVPG8Rv5We4E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048