UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oOVfQg2JXRFgwG0SdKtuX9li4UbgAPiTA2Gu3M5YTj0=' 
WHERE 
  key_id = '3e5138ed20398cf65ca3f30ab1ec9cd3a09ab23e439b4fcf87fcdbb74a64e9a6' 
  AND (
    token = 'oOVfQg2JXRFgwG0SdKtuX9li4UbgAPiTA2Gu3M5YTj0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031