UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xiPYmvDlHo+lWhfUFy/FlnGBsx7wAiDjEpDzIMX/dxE=' 
WHERE 
  key_id = '273aebf8e91a8b917537ca70069cd5c728654c120171bbb36ad467794fcaa312' 
  AND (
    token = 'xiPYmvDlHo+lWhfUFy/FlnGBsx7wAiDjEpDzIMX/dxE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038