UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jdxQx+ZLNmpAJ6HwQSb//GqzWScQ1Cnd20/6ZUziFUg=' 
WHERE 
  key_id = 'c8f5be0b1242c526023b2490d08386d49e618eae82f98129e5ce69ff92d0fc6d' 
  AND (
    token = 'jdxQx+ZLNmpAJ6HwQSb//GqzWScQ1Cnd20/6ZUziFUg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017