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

Query time 0.00018