UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jtspJf1Z+bfWfRPeBo385BK8kPoWl2SkRul5k3cH75Y=' 
WHERE 
  key_id = '3fc9b5a8e4d641d33b8e0b0cb54d695de7571945c5e3e2890221aef00e339911' 
  AND (
    token = 'jtspJf1Z+bfWfRPeBo385BK8kPoWl2SkRul5k3cH75Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039