UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cBD5MzbOEDrfpVyeJGMNWLgHjNSxYMTD1EGdVG3eU8g=' 
WHERE 
  key_id = 'e75fc7b9e7547104f51ed8ba79d69824a8a1ade8e52176d9af9c179a50765ee9' 
  AND (
    token = 'cBD5MzbOEDrfpVyeJGMNWLgHjNSxYMTD1EGdVG3eU8g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029