UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fEEz1FGa8/TaIcb5V3XAipaoaPI89Z0WYvg/4ZeEeEI=' 
WHERE 
  key_id = '12b40dcfe089626036a18a76dea0219de54ca3c812057359f077ab393c836cd5' 
  AND (
    token = 'fEEz1FGa8/TaIcb5V3XAipaoaPI89Z0WYvg/4ZeEeEI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029