UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GlZKC6270wNABTMNaGk6gEdsBQBN169Ao/ypaJu2RVU=' 
WHERE 
  key_id = '73f034e5be6d8bcec4c915e93d37df42de261863b89ceae5c572fc00a5fe596b' 
  AND (
    token = 'GlZKC6270wNABTMNaGk6gEdsBQBN169Ao/ypaJu2RVU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020