UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lV8nyvLtaMUEXLGm8UhhmB9KCWks/sFWzWIARLxqV9A=' 
WHERE 
  key_id = '5c911a82d4fb44a0b9c43742ff4f092d92c1d563279e5100fbbd801094e0b4b5' 
  AND (
    token = 'lV8nyvLtaMUEXLGm8UhhmB9KCWks/sFWzWIARLxqV9A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037