UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e2tkFDF6DsvRoS7z7ix5ur0Knwh0I3Uov3LdR9nE4P0=' 
WHERE 
  key_id = 'a646b446e57321acfa3e210d6e6a68b90ec74577843583fd944f46f7fffd2458' 
  AND (
    token = 'e2tkFDF6DsvRoS7z7ix5ur0Knwh0I3Uov3LdR9nE4P0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00196