UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tJvvs899mSFmb4oYFTpLdaRI4NJHvkJTMXRSZsM52jU=' 
WHERE 
  key_id = '7692b0a624999b6df6cb0f87f3d0c56ff54155b038f87a1dde65a4232ef20084' 
  AND (
    token = 'tJvvs899mSFmb4oYFTpLdaRI4NJHvkJTMXRSZsM52jU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039