UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PLpLbfVxJ6ZdijjIX/L6hQOdP93ggk44XtPfwdw0l3U=' 
WHERE 
  key_id = 'bf544374008f8cc3552df800d9f169bdde1d534ba4ecd744f18372a51ed71a62' 
  AND (
    token = 'PLpLbfVxJ6ZdijjIX/L6hQOdP93ggk44XtPfwdw0l3U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033