UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eoPl4fSpqCBzjqC6t3xooFbfVXBkp/NwA7Uyh/2M1cU=' 
WHERE 
  key_id = 'cffcbdc7e2eae06191c8c1936a9c662829f82c6f35cecdba4456728b30129e65' 
  AND (
    token = 'eoPl4fSpqCBzjqC6t3xooFbfVXBkp/NwA7Uyh/2M1cU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030